package com.shangsi.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 搭建maven的web项目
 * https://blog.csdn.net/gghh2015/article/details/79509557
 * https://segmentfault.com/a/1190000024479828
 * https://iogogogo.github.io/2020/02/26/idea-web-project/
 *
 * 使用注解开发servlet,无需配置 web.xml
 *
 * 运行时插件能力
 * spi机制: Servlet启动 的时候会扫描ServletContainerInitializer文件(WEB-INF/services目录下)
 *    此文件的内容是ServletContainerInitializer的实现类的全限定名
 *
 *
 * @author dzd
 * @date 2021-12-12
 */
@WebServlet("/hello")
public class MyServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        resp.getWriter().write("hello ....");
    }
}
